package src.view;

import src.event.EventListener;
import src.event.events.CursorChangeEvent;

/**
 * <b>Overview</b>
 * The CursorCacheHandler receives and translates cursor updates for the MapDataCache.
 *
 * <b>Responsibilities</b>
 * Receive and translate cursor updates.
 *
 * <b>Collaborators</b>
 * MapDataCache - Client: the MapDataCache receives translated messages from this component.
 * CursorChangeEvent - Subcontractor: CursorChangeEvents describe the change in the model that needs to be reflected in the view.
 *
 * <b>Implementor</b> - Bruce
 * <b>Tester</b> - Tim
 *
 * @author Bruce
 */
public class CursorCacheHandler implements EventListener<CursorChangeEvent>
{
	private MapDataCache cache;

	public CursorCacheHandler(MapDataCache cache)
	{
		this.cache = cache;
	}

	/* (non-Javadoc)
	 * @see src.event.EventListener#eventCallback(src.event.Event)
	 */
	public boolean eventCallback(CursorChangeEvent e)
	{
		cache.select(e.getX(), e.getY());
		return true;
	}
}